import os
from AGDefines import *


fpDict = {}
class Log2File():

    zhangHao = 'md1'


    @staticmethod
    def init(port):
       f = open(WorkPath + '/log_'+str(port)+'.txt','w+')
       fpDict[str(port)] = f

    @staticmethod
    def info(port, log):
        key = str(port)

        if key not in fpDict:
            Log2File.init(port)

        fpDict[key].write(log+'\n')
        fpDict[key].flush()

